import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/dashboard',
    name: 'home',
    component: Home
  },
  {
    path: '/',
    redirect: '/dashboard',
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/document/add',
    name: 'addDocument',
    component: () => import('../views/document/Add.vue')
  },
  {
    path: '/document/list',
    name: 'documentList',
    component: () => import('../views/document/List.vue')
  },
  {
    path: '/document/detail',
    name: 'documentDetail',
    component: () => import('../views/document/Detail.vue')
  },
  {
    path: '/knowledge/add',
    name: 'addKnowledge',
    component: () => import('../views/knowledgeStore/Add.vue')
  },
  {
    path: '/knowledge/list',
    name: 'list',
    component: () => import('../views/knowledgeStore/List.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
